package com.pactera.madp.daemon.quartz.task;

import com.pactera.madp.common.core.constant.SecurityConstants;
import com.pactera.madp.cp.api.feign.RemoteDeptService;
import com.pactera.madp.cp.api.feign.RemoteProductService;
import com.pactera.madp.daemon.quartz.constant.enums.MadpQuartzEnum;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * ProductTask
 *
 * @author huhao
 * @version 1.0
 * 2022/04/16 14:37
 **/
@Slf4j
@Component("productTask")
@AllArgsConstructor
public class ProductTask {

    private final RemoteProductService productService;
    private final RemoteDeptService deptService;

    @SneakyThrows
    public String onSyncClose() {
        productService.onSyncClose(SecurityConstants.FROM_IN);
        return MadpQuartzEnum.JOB_LOG_STATUS_SUCCESS.getType();
    }

}
